package 循环;

import java.util.Scanner;

public class demo02 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入一个数字");
        int a=sc.nextInt();
        long sum=1;
        for(int i=1;i<=a;i++){
            sum*=i;
        }
        System.out.println(a+"的阶乘为"+sum);
    }
}
